\documentclass{article}

\usepackage[square,sort,comma,authoryear]{natbib}
\usepackage{url}

\begin{document}

main text main text citet example: \citet{Test:Book} main text main text main 
main text main text main text(don't forget the half-space, citep:)
ctanchor\,\citep{Test:Book}.
text main text main text main text main text.

\bibliographystyle{abbrvnat}
\bibliography{references}

\end{document}
